﻿/// <summary>
/// data   :2016-04-27
/// author :fanzhengyong
/// ULua管理器
/// 单件实现，负责ULua（LuaScriptMgr）的初始化，并提供接口给外层获得。要调用lua统一从这里取，
/// 确保整个游戏只有唯一的LuaScriptMgr
/// </summary>
/// 

namespace UEngine
{
    public class ULuaManager
    {
        private static ULuaManager m_instance = null;
        public static ULuaManager Instance()
        {
            if (m_instance == null)
            {
                m_instance = new ULuaManager();
                m_instance.Init();
            }
            return m_instance;
        }

        private LuaScriptMgr m_luaScriptMgr = null;

        public void Init()
        {
            if (m_luaScriptMgr == null)
            {
                m_luaScriptMgr = new LuaScriptMgr();
                m_luaScriptMgr.Start();
            }
        }

        public LuaScriptMgr GetLuaScriptMgr()
        {
            return m_luaScriptMgr;
        }
    }
}
